<?php if (!defined('insite')) die("no access"); ?>
<table align="center" valign="top" class="tableMain" width="70%">
<tr>
	<td class="zagstyle" colspan="2"><?=clinv_title?></td>
</tr>
<form method="POST" action="">
<tr>	
	<td><?=clinv_nick?></td>
	<td><input type="text" maxlength="10" name="c_nick" class="texbx"> <input type="checkbox" name="opt1" value="warehouse"><?=clinv_inv?></td>
</tr>
<tr>
	<td colspan="2" align="center"><input type="submit" name="clbtn" value="<?=clinv_btn?>" class="t-button"></td>
</tr>
</form>

<?php
	if ($_REQUEST["clbtn"])
	{
		if ($_POST["c_nick"])
		{
			$need_cl = validate(substr($_POST["c_nick"],0,10));
			$check = $db->fetcarray($db->query("SELECT AccountID FROM Character WHERE Name='".$need_cl."'"));
			if ($check["AccountID"]) 
			{
				require "opt.php";
				$uqery = "UPDATE Character SET Inventory=0x".$config["inventory"]." WHERE AccountID='".$need_cl."'";
				if ($_POST["opt1"]=='warehouse') $uqery.="; UPDATE warehouse SET Items=NULL WHERE AccountID='".$check["AccountID"]."'";
				$db->query($uqery);
				unset($uqery);
				echo "<tr><td class='succes' colspan='2'>All is Ok!</td></tr>";
			} 
			else echo "<tr><td class='warnms' colspan='2'>Character NOT exists</td></tr>";
		}
	}
?>
</table>